<?php  if ( ! defined('SERVER_ROOT')) exit('No direct script access allowed');

function anchor($label,$url,$opts=array()){
    $attr = '';
    foreach($opts as $key => $value){
        $attr .= $key."='".$value."' ";
    }
    $attr = rtrim($attr, ' ');
    return "<a href='".SITE_ROOT.'/'.$url."' $attr>$label</a>";
}

function ulist($list=array(),$opts=array()){
    $attr = '';
    $ul = '';
    foreach($opts as $key => $value){
        $attr .= $key."='".$value."' ";
    }
    $attr = rtrim($attr, ' ');
    $ul = "<ul $attr>\n";
    foreach ($list as $li){
        $ul .= "  <li>$li</li>\n";
    }
    $ul .= "</ul>";
    return $ul;
}